package lily.com.app;

import android.content.Context;
import android.view.MotionEvent;
import android.widget.ListView;

public class TaskListView extends ListView {

	public TaskListView(Context context) {
		super(context);
	}
	
	private GestureListener guestureListener = null;

	public void setInterceptTouchListner(GestureListener listener){
		this.guestureListener = listener;
	}
	
	@Override
	public boolean onInterceptTouchEvent(MotionEvent ev) {
//		Log.d("DEBUG", "onInterceptTouchEvent");
		return guestureListener.onTouch(this, ev);
	}
	
//	@Override
//	public boolean onTouchEvent(MotionEvent ev) {
//		guestureListener.onTouch(this, ev);
//		return false;
//	}
	
//	TODO to delete
//	@Override
//	public boolean onTouchEvent(MotionEvent ev) {
//		Log.d("DEBUG", "onTouchEvent");
//		switch (ev.getAction() & MotionEvent.ACTION_MASK) {
//		case MotionEvent.ACTION_DOWN:
//			Log.d("DEBUG", "ACTION_DOWN");
//			break;
//		case MotionEvent.ACTION_POINTER_DOWN:
//			Log.d("DEBUG", "ACTION_POINTER_DOWN");
//			break;
//		case MotionEvent.ACTION_UP:
//			Log.d("DEBUG", "ACTION_UP");
//			break;
//		case MotionEvent.ACTION_POINTER_UP:
//			Log.d("DEBUG", "ACTION_POINTER_UP");
//			break;
//		case MotionEvent.ACTION_MOVE:
//			Log.d("DEBUG", "ACTION_MOVE");
//			break;
//		case MotionEvent.ACTION_CANCEL:
//			Log.d("DEBUG", "ACTION_CANCEL");
//			break;
//		}
//		return super.onTouchEvent(ev);
//	}
}
